#define _CRT_SECURE_NO_WARNINGS 1
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
#include<unordered_map>
using namespace std;

class Solution {
public:
    string countAndSay(int n) {
        if (n == 1) return "1";
        string s = "1";
        for (int i = 1; i < n; i++)
        {
            int sum = 1;
            int len = s.size();
            string tmp = "";
            for (int j = 0; j < len; j++)
            {
                if (j + 1 != len && s[j + 1] == s[j])
                {
                    sum++;
                    continue;
                }
                else
                {
                    tmp += to_string(sum);
                    tmp += s[j];
                    sum = 1;
                }
            }
            swap(tmp, s);
        }
        return s;
    }
};
int main() {
    return 0;
}